import java.util.Scanner;
import java.util.*;

public class MC0411数位之和 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int[] arr = new int[n];
        int count = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
            while (arr[i] > 0) {
                count += arr[i] % 10;
                arr[i] /= 10;
            }
        }
        System.out.println(count);
        input.close();
    }
}
